<div class="bs-callout bs-callout-info">
    <h4>Edit category</h4>
    <p><a href="<?php echo base_url()?>admin/category">+ Back</a></p>
</div>

<form class="form-horizontal" role="form" method="POST">
    <div class="form-group">
        <label for="parentid" class="col-sm-2 control-label">Parent</label>
        <div class="col-sm-10">
            <select class="form-control" id="parentid" name="parentid">
                <option value="0">Không</option>
                <?php foreach($categories as $k=>$v) {?>
                    <option value="<?php echo $v['id'];?>" <?php if($data['parentid']==$v['id']) echo 'selected';?>><?php echo $v['categoryname'];?></option>
                <?php }?>
            </select>
        </div>
    </div>
    
    <div class="form-group">
        <label for="categoryname" class="col-sm-2 control-label">Category name</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="categoryname" placeholder="Category name" name="categoryname" value="<?php echo $data['categoryname'];?>" />
        </div>
    </div>
    
    <div class="form-group">
        <label for="slug" class="col-sm-2 control-label">Slug</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="slug" placeholder="Slug" name="slug" value="<?php echo $data['slug'];?>" />
        </div>
    </div>
    
    <div class="form-group">
        <label for="number" class="col-sm-2 control-label">Order</label>
        <div class="col-sm-10">
            <input type="number" class="form-control" id="number" placeholder="Order" name="number" value="<?php echo $data['number'];?>" />
        </div>
    </div>    
    
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default">Save</button>
        </div>
    </div>
</form>